package day1026_2;

class  PropertyException extends  Exception{
    PropertyException(String msg){
        super(msg);
    }
}
public class EmployeeN {
    private int id;
    private String name;
    private char  sex;
    public void setId(int id) throws   PropertyException{
        if(id<0){
            throw  new PropertyException("id无效");
        }
        this.id = id;
        System.out.println("成功给EmployeeN类型的对象属性id赋值了");
    }
    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public char getSex() {
        return sex;
    }
    public void setSex(char sex) {
        this.sex = sex;
    }
    //get  set
}


